home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / WD_SRC.ZIP / SYSTEM / SCREEN.HPP < prev    next >
C/C++ Source or Header  |  1995-01-10  |  2KB  |  84 lines

  1. #ifdef MODE_X
  2.  
  3. /*
  4.     xxxxADDR defines the base port number used to access VGA component xxxx,
  5.     and is defined for xxxx =
  6.         ATTRCON         -       Attribute Controller
  7.         MISC            -       Miscellaneous Register
  8.         VGAENABLE       -       VGA Enable Register
  9.         SEQ                     -       Sequencer
  10.         GRACON          -       Graphics Controller
  11.         CRTC            -       Cathode Ray Tube Controller
  12.         STATUS          -       Status Register
  13. */
  14.  
  15. #define ATTRCON_ADDR    0x3c0
  16. #define MISC_ADDR               0x3c2
  17. #define VGAENABLE_ADDR  0x3c3
  18. #define SEQ_ADDR                0x3c4
  19. #define GRACON_ADDR             0x3ce
  20. #define CRTC_ADDR               0x3d4
  21. #define STATUS_ADDR             0x3da
  22.  
  23.  
  24. /*
  25.     Note that the following C definition of Register is not compatible
  26.     with the C++ definition used in the source code of TWEAK itself!
  27. */
  28.  
  29. typedef struct
  30.     {
  31.     unsigned port;
  32.     unsigned char index;
  33.     unsigned char value;
  34.     } Register;
  35.  
  36. typedef Register *RegisterPtr;
  37.  
  38. void readyVgaRegs(void);
  39. void outRegArray(Register *r, int n);
  40. void outReg(Register r);
  41.  
  42. void sX_SetPixel( short x, short y, char color );
  43.  
  44. #endif
  45.  
  46.  
  47. BOOL s_SetVideoMode( WORD vidMode );
  48. BOOL s_Init();  
  49. BOOL s_UnInit( BOOL bDeleteMaps );
  50. BOOL s_Clear( BYTE fillWith );
  51. BOOL s_ClearHalf( BYTE fillWith );
  52.  
  53. // Blits only the region of the offscreen buffer to a position on the screen.
  54. BOOL s_DrawRegion( DWORD x1, DWORD y1, DWORD x2, DWORD y2, DWORD destX, DWORD destY );
  55.  
  56. // Blits the entire offscreen buffer.
  57. BOOL s_Draw();
  58.  
  59. void ResetVideoMode(WORD mode);
  60.  
  61. void s_BlitChar(int xc,int yc,char c,int color,int trans_flag);
  62. void s_BlitString(int x,int y,int color, char *string,int trans_flag);
  63.  
  64.  
  65. #ifdef DOS
  66. BOOL s_SetPalette( char *palette );
  67. BOOL s_Alert( char *message );
  68.  
  69. void s_SetMode( char modeNum );
  70. char s_GetMode();          
  71.  
  72. void s_WaitForRetrace();
  73. #endif
  74.  
  75. // Assembler functions.
  76. void s_ScreenBlit( BYTE *pDest, BYTE *pSource, WORD nDWords );
  77. void s_DWordMemSet( BYTE *pDest, BYTE fillWith, DWORD numDWords );
  78.  
  79. BOOL s_SetPaletteMaps();
  80.  
  81. // Stupid quick functions for when I get lazy (they check boundaries).
  82. BOOL s_SetPixel( WORD x, WORD y, BYTE color );
  83.  
  84.